/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


var fieldLabel = new Array('单位名称','连续7日无数据测点','昨日','本月',
                            '上月合格率缺失数量');
var fieldName=new Array("companyName","7dayNoDataPointNumber","yesterday","thisMonth",
                        "lastMonthRateDefectNumber",'rn');
var _pageSize=20;

var centerstore=new Ext.data.JsonStore({               
    //data: [
    //       ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17']
    //]
    url: "../../servlet/report/gridvoltagepoint",
    root: 'data',
    idProperty: 'id',
    totalProperty: 'count',
    fields: fieldName,
    autoLoad: true
});



var centercolumnModel = new Ext.grid.ColumnModel({
    columns: [
    {header: '序号',width: 40, dataIndex: 'rn', align: 'center'},    
    {header: fieldLabel[0],width: 100, dataIndex: fieldName[0], align: 'center'},
    {header: fieldLabel[1],width: 100, dataIndex: fieldName[1], align: 'center'},
    {header: fieldLabel[2],width: 100, dataIndex: fieldName[2], align: 'center'},
    {header: fieldLabel[3],width: 100, dataIndex: fieldName[3], align: 'center'},
    {header: fieldLabel[4],width: 100, dataIndex: fieldName[4], align: 'center'},
    ],
    defaultSortable: true,
    rows: [
        [
        {width: 100, rowspan: 1},
        {width: 100, rowspan: 1},
        {width: 100, rowspan: 1},
        {width: 100, header: '日合格率缺失数量', colspan: 2, align: 'center',rowspan:1}, 
        {width: 100, rowspan: 1}
        ]
        ]
});

var grid=new Ext.grid.GridPanel({
    title: '电压采集数据完整性查询',
    store: centerstore,
    colModel:centercolumnModel,
    enableColumnMove: false,
    viewConfig: {
        forceFit: true
    },
    plugins: [new Ext.ux.plugins.GroupHeaderGrid()],
    loadMask: true,
    bbar: new Ext.PagingToolbar({
        pageSize: _pageSize,
        store: centerstore,
        displayInfo: true,
        displayMsg: '显示记录：{0} - {1}   总记录：{2}',
        emptyMsg:  '目前没有信息'
    })
});
centerstore.load({
    params: {
        start: 0, 
        limit: _pageSize
    }
})
function buildWindow(){
    var applicationUI = new Ext.Viewport({
        layout:'fit',
        items: [
        grid
        ]
    });
}
Ext.onReady(buildWindow); 